from tortoise import BaseDBAsyncClient


async def upgrade(db: BaseDBAsyncClient) -> str:
    return """
        ALTER TABLE `tb_monitor_task` ADD `executor` VARCHAR(50) NOT NULL COMMENT '执行器';
        ALTER TABLE `tb_monitor_task` ADD `jobstore` VARCHAR(50) NOT NULL COMMENT '储存器';
        ALTER TABLE `tb_monitor_task` MODIFY COLUMN `trigger_args` VARCHAR(20) NOT NULL COMMENT 'trigger表达式';"""


async def downgrade(db: BaseDBAsyncClient) -> str:
    return """
        ALTER TABLE `tb_monitor_task` DROP COLUMN `executor`;
        ALTER TABLE `tb_monitor_task` DROP COLUMN `jobstore`;
        ALTER TABLE `tb_monitor_task` MODIFY COLUMN `trigger_args` VARCHAR(20) NOT NULL COMMENT '触发器参数';"""
